#if !defined(_SCRIPT_CODE_H_2005_08_26_INCLUDED_)
#define _SCRIPT_CODE_H_2005_08_26_INCLUDED_

#pragma once

//menu View->Page Zoom->50%
static char JAVASRIPT_PageSize50[] = 
	"<script language=\"JavaScript\"> document.body.style.zoom=\"50%\"; </script>";

//menu View->Page Zoom->100%
static char JAVASRIPT_PageSize100[] = 
	"<script language=\"JavaScript\"> document.body.style.zoom=\"100%\"; </script>";

//menu View->Page Zoom->200%
static char JAVASRIPT_PageSize200[] =
	"<script language=\"JavaScript\"> document.body.style.zoom=\"150%\"; </script>";

//menu View->Page Zoom->More
static char JAVASRIPT_PagesizeAdd10[] =
	"<script language=\"JavaScript\"> \
	var i = parseInt(document.body.style.zoom);	if(isNaN(i))i=100; \
	if(i<0)i=0; if(i==19)i=18; newZoom=i+10+'%'; document.body.style.zoom=newZoom; \
	</script>";

//menu View->Page Zoom->Less
static char JAVASRIPT_PagesizeDec10[] =
	"<script language=\"JavaScript\"> \
	var i = parseInt(document.body.style.zoom);	if(isNaN(i))i=100; \
	if(i<18)i=18; newZoom=i-10+'%'; document.body.style.zoom=newZoom; \
	</script>";

//menu Edit->Copy as HTML
static char JAVASRIPT_CopyAsHTML[] = 
	"<script language=\"JavaScript\"> \
	var selectedHtml=(document.selection.createRange()).htmlText; \
	if(selectedHtml!= \"\") window.clipboardData.setData(\"Text\",selectedHtml); \
	</script>";


//#define STR_RELOAD_UNSHOWN_IMAGE	
static char JAVASCRIPT_ReloadUnshownImage[] =
"	function cancelError() {return true;} onerror=cancelError; \
	var i,len,src,img; \
	len=document.images.length; \
	for(i=0;i<len;i++) \
	{ \
		img=document.images[i]; \
		if(!img.complete||img.fileSize<0) \
		{ src=img.src; img.src=''; img.src=src; } \
	}"	;

//#define STR_KILL_BLANK	
static char JAVSCRIPT_KillBlank[] =
"	function cancelError() {return true;} onerror=cancelError; \
	function killTag(tagName) \
	{ \
		var url; \
		var objs=document.getElementsByTagName(tagName); \
		for(i=0;i<objs.length;i++) \
		{ \
			url = tagName=='object'?objs[i].movie:objs[i].src; \
			if (url.indexOf('://')<0) \
	  		{ \
				url = document.URL.substring(0,document.URL.lastIndexOf('/')+1); \
				url += tagName=='object'?objs[i].movie:objs[i].src; \
	  		} \
			if(external.gbIsAdContent(url)) \
			{ \
				objs[i].outerHTML='$AD'; \
				i--; \
			} \
		} \
	} \
	killTag('iframe');killTag('img');killTag('embed');killTag('object');";

//#define STR_KILL_FLYING	
static char JAVSCRIPT_KillFlying[] = 
"	function cancelError() {return true;} onerror=cancelError; \
	function newpropertychange(){ \
		var name = event.propertyName.toLowerCase(); \
		var elem = event.srcElement; \
		if( name.indexOf('left')>-1||name.indexOf('top')>-1||name.indexOf('move')>-1) \
		{ try{ elem.onpropertychange = null; elem.style.visibility = 'hidden'; elem.srcElement.removeNode(true); }catch(e){} } \
	} \
	function killobj(doc,obj){ \
		var objs=doc.document.getElementsByTagName(obj); \
		for (var i=0;i<objs.length;i++){ \
			var obj=objs[i]; \
			if ((obj.style.position=='absolute'&&obj.style.display!='none')||(obj.tagName=='SPAN'&&obj.style.left!='auto')||(obj.tagName=='EMBED'&&obj.src.toLowerCase().indexOf('.swf')!=-1)||(obj.tagName=='OBJECT'&&obj.classid.toLowerCase()=='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000')) \
			{ try{ obj.onpropertychange = newpropertychange; }catch(e){} } \
		} \
	} \
	function killflying(doc){ \
		killobj(doc,'div'); killobj(doc,'span'); killobj(doc,'img'); killobj(doc,'object'); killobj(doc,'embed');  \
		if(doc.layers) killobj(doc,'layer'); \
	} \
	if(location.hostname.indexOf('.google.com')==-1) \
		killflying(self);";

#endif //#if !defined(_SCRIPT_CODE_H_2005_08_26_INCLUDED_)